# -*-coding:utf-8 -*-
import pymongo
from config.conf import get_db_args,get_mysql_args
# from sqlalchemy import create_engine, MetaData
# from sqlalchemy.orm import sessionmaker
# from sqlalchemy.ext.declarative import declarative_base




eng = get_db_args()
connection = pymongo.MongoClient(eng['host'], int(eng['port']),)

# def get_engine():
#     args = get_mysql_args()
#     connect_str = "{}+pymysql://{}:{}@{}:{}/{}?charset=utf8".format(args['db_type'], args['user'], args['password'],
#                                                              args['host'], args['port'], args['db_name'])
#     engine = create_engine(connect_str, encoding='utf-8')
#     return engine
#
# eng = get_engine()
# Base = declarative_base()
# Session = sessionmaker(bind=eng)
# db_session = Session()
# metadata = MetaData(get_engine())

# if __name__ == '__main__':
#     print(db_session)



__all__ = ['eng', 'Base', 'db_session', 'metadata']
